﻿


/*========================================================================================
//Goodasong -- MySnake
//创建者: 郑雪松
//创建时间：2013年1月31日
//类描述：实体类 BdProduct (属性说明自动提取数据库字段的描述信息)
//最后修改者:郑雪松
//最后修改时间:2013年1月31日	
=========================================================================================*/
using System;
using System.Web;
using System.Runtime.Serialization;

namespace COM.Rights.Model
{
    /// <summary>
    /// 实体类 BdProduct (属性说明自动提取数据库字段的描述信息)
    /// </summary>
    [Serializable]	  
    [Model(Name = "BdProduct", PrimaryKey = "GID", ModelType = ModelType.Table, Condition = "1=1", IsNeedRecordModify = true)]
    public partial class BdProductInfo : BaseModel
    {
        public BdProductInfo()
        {            
            PrimaryKey = "GID"; 
			Fields.Add("GID");//GID
			Fields.Add("ProductName");//ProductName
			
			
			this.OnCreated();			
			this.OnModelCreated();
        }
		public BdProductInfo(bool isNewInfo):this()
        {
			IsNew = isNewInfo;
		}
		#region 方法

        public void OnCreated() { this.SetPrimaryKeyValue(); }		

		public override void SetPrimaryKeyValue()
        {
			
        }
        #endregion 
		
		#region 成员变量
				
		private int? _GID;//GID
		private string _ProductName;//ProductName
		
		#endregion
		
		#region 属性 
		
		/// <summary>
        /// GID
        /// </summary>       
		[ModelField(Description = "GID", Type = typeof(int?), ErrorMessage = "GID信息错误!", FieldType = FieldType.Normal, IsKeyField = true,IsUnique = true, IsForeignKey = false, IsAllowNull = false, IsDbGenerated = false, Size = 4,  DbType = "int", IsNeedRecordModify = true)]
        public virtual int? GID
        {
            get
            {
                return this._GID;
            }
            set
            {
				_GID = value;
            }
        }
		
		/// <summary>
        /// ProductName
        /// </summary>       
		[ModelField(Description = "ProductName", Type = typeof(string), ErrorMessage = "ProductName信息错误!", FieldType = FieldType.Normal, IsKeyField = false,IsUnique = false, IsForeignKey = false, IsAllowNull = true, IsDbGenerated = false, Size = 100,  DbType = "nvarchar", IsNeedRecordModify = true)]
        public virtual string ProductName
        {
            get
            {
                return this._ProductName;
            }
            set
            {
                if (_ProductName != value || (_ProductName == null && value == null))
                {
                    if (!IsGetDataFromDB)
                    {
                        ModifyInfo modifyInfo = new ModifyInfo("BdProduct", "ProductName", _ProductName, value, "nvarchar", "ProductName");   
                        this.OnPropertyChanging(modifyInfo);
                        this.OnProductNameChanging(modifyInfo);
                        this.SendPropertyChanging(modifyInfo);

                        this._ProductName = value;

                        this.OnPropertyChanged(modifyInfo);
                        this.OnProductNameChanged(modifyInfo);
                        this.SendPropertyChanged(modifyInfo);      
                    }
                    else
                    {
                        _ProductName = value;
                    }
                }
            }
        }
		#endregion 属性
				  
		#region 属性更改事件
		
		partial void OnGIDChanging(ModifyInfo modifyInfo);//GIDGID改变之前发生
        partial void OnGIDChanged(ModifyInfo modifyInfo);//GIDGID改变之后发生
		partial void OnProductNameChanging(ModifyInfo modifyInfo);//ProductNameProductName改变之前发生
        partial void OnProductNameChanged(ModifyInfo modifyInfo);//ProductNameProductName改变之后发生
		
		#endregion		
		public virtual string DetailURI { get; set; }
        public virtual string DetailHTMLURI { get; set; }
		public virtual string ManageEditURI {get; set;}
		public virtual string ManageDetailURI {get; set;}
		public override void OnLoaded()
        {
            base.OnLoaded();	
			DetailURI = ZModel.InitDetailURI("BdProduct", "GID", GID);
            DetailHTMLURI = ZModel.InitDetailHTMLURI("BdProduct", "GID", GID);		
			ManageEditURI = ZModel.InitMEditURI("BdProduct", "GID", GID);	
		 	ManageDetailURI = ZModel.InitMDetailURI("BdProduct", "GID", GID);	
			OnModelLoaded();
        }
		
		partial void OnModelCreated();
        partial void OnModelLoaded();
	}	
}